package objectAdder;

import doorAndWindow.OnWallObject;
import house.HouseSketch;
import returnTypes.FinalValues;
import returnTypes.Location;
import tester.DoorWindowTester;
import wall.Wall;

public class DoorAndWindowAdder {
	public HouseSketch addonWallObject(OnWallObject object,Location loc,Wall wall,HouseSketch house)
	{
		DoorWindowTester tester=new DoorWindowTester();
		tester.insertOnWallObject(object, wall, loc);
			if(tester.isSucces()==true){
				int[][] auxiliary=tester.getTestDoorWindowMatrix();
				int capitation=tester.getCapitation();
				for(int i=0;i<FinalValues.getMaxX();i++)
					for(int j=0;j<FinalValues.getMaxY();j++)
				if (auxiliary[i][j]==capitation) house.setMatrixXY(i, j, capitation);
			}
		
		return house;
	}
}
